class Person:
    def __init__(self, basic_salary):
        self.basic_salary = basic_salary

    def get_salary(self):
        return self.basic_salary


class Programmer(Person):
    def __init__(self, basic_salary, project_salary):
        super().__init__(basic_salary)
        self.project_salary = project_salary

    def total_salary(self):
        return super().get_salary() + self.project_salary


class Salesman(Person):
    def __init__(self, basic_salary, sale_fit):
        super().__init__(basic_salary)
        self.sale_fit = sale_fit

    def total_salary(self):
        return super().get_salary() + self.sale_fit


class Acct:

    def __init__(self):
        self.__all_employee = []

    def add_employee(self, employee):
        if isinstance(employee, Person):
            self.__all_employee.append(employee)

    def pay_salary(self):
        total_money = 0
        for person in self.__all_employee:
            print("发了：" + str(person.total_salary()))
            total_money += person.total_salary()
        print('总共发了%s' % total_money)


boss = Acct()
boss.add_employee(Programmer(8000, 3000))
boss.add_employee(Salesman(4000, 6000))
boss.pay_salary()
